package com.huanwei.me_question.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.huanwei.cc.R;
import com.huanwei.cc.base.Base_Z_Adapter;
import com.huanwei.cc.base.MyApplication;
import com.huanwei.cc.bean.ChengJi;
import com.huanwei.cc.newbean.KeCheng;


/**
 * Created by 他的猫 on 2016/12/3.
 * 我的went适配器
 */

public class CJ_Adapter extends Base_Z_Adapter {
    CJ_Adapter.Holder holder;


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        // 查找控件
        if (null == convertView) {
            convertView = LayoutInflater.from(MyApplication.getInstance())
                    .inflate(R.layout.item_chengji, null);
            holder = new CJ_Adapter.Holder();
            holder.kemu = (TextView) convertView
                    .findViewById(R.id.kemu);
            holder.chengji = (TextView) convertView
                    .findViewById(R.id.chengji);

            holder.biaoti = (TextView) convertView
                    .findViewById(R.id.biaoti);
            holder.shijian = (TextView) convertView
                    .findViewById(R.id.shijian);
            holder.leixing = (TextView) convertView
                    .findViewById(R.id.leixing);
            // 缓存Holder
            convertView.setTag(holder);
        } else {
            holder = (CJ_Adapter.Holder) convertView.getTag();
        }
        ChengJi.DataBean teacher = (ChengJi.DataBean) mDataList.get(position);

        holder.kemu.setText("发布人:" + teacher.getName());
        holder.chengji.setText("内容:" + teacher.getAchievement());
        holder.biaoti.setText("标题:" + teacher.getNumber());
        holder.leixing.setText("反馈:" + teacher.getKemu());
        holder.shijian.setText("时间:" + teacher.getTime());
        return convertView;
    }

    public class Holder {
        TextView kemu;
        TextView chengji;
        TextView shijian;
        TextView biaoti, leixing;


    }


}
